﻿<%@ Page Language="C#" MasterPageFile="~/admin/MasterPage.master" AutoEventWireup="true"
    CodeFile="Gabarito.aspx.cs" Inherits="admin_Gabarito" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <asp:UpdateProgress ID="UpdateProgress1" AssociatedUpdatePanelID="UpdatePanel1" runat="server">
        <ProgressTemplate>
        </ProgressTemplate>
    </asp:UpdateProgress>
    <br />
    <div class="titulo">
        <asp:Label ID="lblTitulo" runat="server" Text="Gabarito oficial"></asp:Label>
    </div>
    <br />
    <div class="grid">
        <div class="campos">
            <div class="coluna_titulo">
                <asp:Label ID="Label3" runat="server" Text="Processo:"></asp:Label>
            </div>
            <div class="coluna_texto2">
                <asp:DropDownList ID="cod_processo_pro" AppendDataBoundItems="true" DataSourceID="odsProcesso"
                    DataTextField="des_processo_pro" DataValueField="des_processo_pro" runat="server"
                    EnableViewState="false" Width="200px">
                    <asp:ListItem Value="-1">Todos</asp:ListItem>
                </asp:DropDownList>
                <asp:ObjectDataSource ID="odsProcesso" TypeName="ProcessoSeletivo.DAO.Processo" SelectMethod="ListarProcessoDescricao"
                    runat="server"></asp:ObjectDataSource>
            </div>
            <div class="coluna_titulo">
                <asp:Label ID="Label4" runat="server" Text="Tipo:"></asp:Label>
            </div>
            <div class="coluna_texto2">
                <asp:DropDownList ID="tip_processo_pro" runat="server" EnableViewState="false" Width="200px">
                    <asp:ListItem Value="-1">Todos</asp:ListItem>
                    <asp:ListItem Value="1">Normal</asp:ListItem>
                    <asp:ListItem Value="2">Agendado</asp:ListItem>
                </asp:DropDownList>
            </div>
            <div class="clear">
            </div>
        </div>
        <div class="button">
            <asp:Button ID="btnConsultar" runat="server" Text="Consultar" />
            <asp:Button ID="btnCadastrar" runat="server" Text="Cadastrar" PostBackUrl="GabaritoCad.aspx" />
        </div>
        <br />
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
                <asp:GridView ID="grvPrincipal" runat="server" AllowPaging="true" AllowSorting="true"
                    PageSize="25" DataKeyNames="cod_processo_pro" DataSourceID="odsPrincipal" EnableViewState="false"
                    Width="760px" OnRowDataBound="grvPrincipal_RowDataBound">
                    <Columns>
                        <asp:BoundField DataField="des_processo_pro" HeaderText="Processo" SortExpression="des_processo_pro">
                            <HeaderStyle HorizontalAlign="Left" VerticalAlign="Top" />
                            <ItemStyle HorizontalAlign="Left" VerticalAlign="Top" />
                        </asp:BoundField>
                        <asp:BoundField DataField="tip_processo_pro" HeaderText="Tipo" SortExpression="tip_processo_pro">
                            <HeaderStyle HorizontalAlign="Left" VerticalAlign="Top" />
                            <ItemStyle HorizontalAlign="Left" VerticalAlign="Top" />
                        </asp:BoundField>
                        <asp:BoundField DataField="dat_cadastro_gab" HeaderText="Data do cadastro" SortExpression="dat_cadastro_gab"
                            DataFormatString="{0:dd/MM/yyyy}">
                            <HeaderStyle HorizontalAlign="Left" VerticalAlign="Top" />
                            <ItemStyle HorizontalAlign="Left" VerticalAlign="Top" />
                        </asp:BoundField>
                        <asp:BoundField DataField="des_login_usu" HeaderText="Usuário que cadastrou" SortExpression="des_login_usu">
                            <HeaderStyle HorizontalAlign="Left" VerticalAlign="Top" />
                            <ItemStyle HorizontalAlign="Left" VerticalAlign="Top" />
                        </asp:BoundField>
                        <asp:TemplateField>
                            <HeaderStyle HorizontalAlign="Right" VerticalAlign="Top" />
                            <ItemStyle HorizontalAlign="Right" VerticalAlign="Top" Width="20px" />
                            <ItemTemplate>
                                <asp:ImageButton ID="btnAlterar" runat="server" Width="16px" Height="16px" PostBackUrl='<%# Eval("cod_processo_pro", "GabaritoCad.aspx?cod_processo_pro={0}") %>'
                                    ImageUrl="~/img/editar.png" />
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                    <EmptyDataTemplate>
                        Nenhum registro foi encontrado!
                    </EmptyDataTemplate>
                </asp:GridView>
            </ContentTemplate>
        </asp:UpdatePanel>
    </div>
    <asp:ObjectDataSource ID="odsPrincipal" runat="server" TypeName="ProcessoSeletivo.DAO.Gabarito"
        SelectMethod="ListarGabaritoPorFiltro">
        <SelectParameters>
            <asp:ControlParameter ControlID="cod_processo_pro" Name="des_processo_pro" Type="String"
                PropertyName="SelectedValue" />
            <asp:ControlParameter ControlID="tip_processo_pro" Name="tip_processo_pro" Type="Int32"
                PropertyName="SelectedValue" />
        </SelectParameters>
    </asp:ObjectDataSource>
</asp:Content>
